<?php defined('SYSPATH') or die('No direct script access.');
 
class Model_Asocial extends ORM {
	protected $_table_name = 'social';

    public function params() {
        return array(
        	'model' => 'Asocial',
            'table' => 'social',
            'fields' => array(
                'title' => array(
                    'title' => 'Заголовок',
                    'type' => 'text',
                    'name' => 'title',
                ),
                'link' => array(
                    'title' => 'Ссылка',
                    'type' => 'text',
                    'name' => 'link',
                ),
                'image' => array(
                    'title' => 'Изображение',
                    'type' => 'image',
                    'name' => 'image',
                    'image_params' => array(
                        'handling' => 'resize',
                        'resize_type' => Image::WIDTH,
                        'width' => 32,
                        'height' => 32,
                        'dir' => $_SERVER['DOCUMENT_ROOT'].'/static/uploads/social',
                        'url' => URL::base().'static/uploads/social',
                    ),
                    'thumbnails' => array(
                        'admin' => array(
                            'width' => 32,
                            'height' => 32,
                            'handling' => 'resize',
                            'resize_type' => Image::WIDTH,
                        ),
                    ),
                ),
            ),
            'main_title' => 'Я в соц. сетях',
            'waymark' => 'title',
            'sortable' => TRUE,
            'admin_image_field' => 'image',
        );
    }

}